/**  

* @author renbangjie renbangjie@126.com  
* @version V1.0  
*/
package com.ai.service.reviewed.service.impl;

import java.util.Date;
import javax.annotation.Resource;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import com.ai.common.core.mapper.Mapper;
import com.ai.common.core.service.impl.BaseServiceImpl;
import com.ai.mmd.reviewed.dto.JzxhginfoDTO;
import com.ai.service.reviewed.dao.JzxhginfoModelMapper;
import com.ai.service.reviewed.model.JzxhginfoModel;
import com.ai.service.reviewed.service.IJzxhginfoService;

/**
* 
*	登陆信息的业务实现类
* 
* @author renbangjie renbangjie@126.com
*/
@Service("ijzxhginfoService")
public class JzxhginfoServiceImpl extends BaseServiceImpl<JzxhginfoModel>
		implements IJzxhginfoService {
	
	/**
	 * 编辑货运单
	 * @param JzxslinfoDTO
	 * @return
	 * @throws Exception
	 */
	public void edithyd(JzxhginfoDTO jzxhginfoDTO)throws Exception {
		
		JzxhginfoModel jzxhginfoModel = new JzxhginfoModel();
		BeanUtils.copyProperties(jzxhginfoDTO, jzxhginfoModel);
		if (jzxhginfoDTO.getId()!=null) {
			//更新
			jzxhginfoModel.setGxsj(new Date());
			jzxhginfoModelMapper.updateByPrimaryKey(jzxhginfoModel);
		}else{
			//新增
			jzxhginfoModel.setCjsj(new Date());
			jzxhginfoModel.setGxsj(new Date());
			jzxhginfoModelMapper.insert(jzxhginfoModel);
		}
	}
	
	@Resource(name = "jzxhginfoModelMapper")
	private JzxhginfoModelMapper jzxhginfoModelMapper;
	
	@Override
	protected Mapper<JzxhginfoModel> getMapper() {
		return jzxhginfoModelMapper;
	}

}
